Do a size_request on the button and cell_view_frame, otherwise their style
authorMatthias Clasen <maclas@gmx.de>
Sun, 7 Mar 2004 01:37:06 +0000 (01:37 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 7 Mar 2004 01:37:06 +0000 (01:37 +0000)
Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a
size_request on the button and cell_view_frame, otherwise
their style will still be the default here in the initial
size_request. (#136301, Mark McLoughlin)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index 6861a16c2100c05b881f06eaaaf3f0725144b552..720b57bceb4c860c9ae501b7b8ae40fc27b400ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a 
+       size_request on the button and cell_view_frame, otherwise
+       their style will still be the default here in the initial 
+       size_request. (#136301, Mark McLoughlin)
+
 2004-03-06  Gustavo J. A. M. Carneiro  <gustavo@users.sourceforge.net>
 
        * gtk/gtktoolbar.c (internal_insert_element): Check return value
index 6861a16c2100c05b881f06eaaaf3f0725144b552..720b57bceb4c860c9ae501b7b8ae40fc27b400ae 100644 (file)
@@ -1,3 +1,10 @@
+Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a 
+       size_request on the button and cell_view_frame, otherwise
+       their style will still be the default here in the initial 
+       size_request. (#136301, Mark McLoughlin)
+
 2004-03-06  Gustavo J. A. M. Carneiro  <gustavo@users.sourceforge.net>
 
        * gtk/gtktoolbar.c (internal_insert_element): Check return value
index 6861a16c2100c05b881f06eaaaf3f0725144b552..720b57bceb4c860c9ae501b7b8ae40fc27b400ae 100644 (file)
@@ -1,3 +1,10 @@
+Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a 
+       size_request on the button and cell_view_frame, otherwise
+       their style will still be the default here in the initial 
+       size_request. (#136301, Mark McLoughlin)
+
 2004-03-06  Gustavo J. A. M. Carneiro  <gustavo@users.sourceforge.net>
 
        * gtk/gtktoolbar.c (internal_insert_element): Check return value
index 6861a16c2100c05b881f06eaaaf3f0725144b552..720b57bceb4c860c9ae501b7b8ae40fc27b400ae 100644 (file)
@@ -1,3 +1,10 @@
+Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a 
+       size_request on the button and cell_view_frame, otherwise
+       their style will still be the default here in the initial 
+       size_request. (#136301, Mark McLoughlin)
+
 2004-03-06  Gustavo J. A. M. Carneiro  <gustavo@users.sourceforge.net>
 
        * gtk/gtktoolbar.c (internal_insert_element): Check return value
index 6861a16c2100c05b881f06eaaaf3f0725144b552..720b57bceb4c860c9ae501b7b8ae40fc27b400ae 100644 (file)
@@ -1,3 +1,10 @@
+Sun Mar  7 02:38:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_size_request): Do a 
+       size_request on the button and cell_view_frame, otherwise
+       their style will still be the default here in the initial 
+       size_request. (#136301, Mark McLoughlin)
+
 2004-03-06  Gustavo J. A. M. Carneiro  <gustavo@users.sourceforge.net>
 
        * gtk/gtktoolbar.c (internal_insert_element): Check return value
index 28768b0512f67729532994f062fb08100b402b86..fb706cc83bdd5e4d498cbc1b781dca5f56f97be0 100644 (file)
@@ -624,7 +624,7 @@ static void
 gtk_combo_box_style_set (GtkWidget *widget,
                          GtkStyle  *previous)
 {
-  gboolean appearance;
+  gboolean appears_as_list;
   GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
 
   gtk_widget_queue_resize (widget);
@@ -636,11 +636,10 @@ gtk_combo_box_style_set (GtkWidget *widget,
     return;
 
   gtk_widget_style_get (widget,
-                        "appears-as-list", &appearance,
+                        "appears-as-list", &appears_as_list,
                         NULL);
 
-  /* TRUE is windows style */
-  if (appearance)
+  if (appears_as_list)
     {
       /* Destroy all the menu mode widgets, if they exist. */
       if (GTK_IS_MENU (combo_box->priv->popup_widget))
@@ -1206,9 +1205,10 @@ gtk_combo_box_size_request (GtkWidget      *widget,
 
       if (combo_box->priv->cell_view)
         {
-          GtkRequisition sep_req, arrow_req;
+          GtkRequisition button_req, sep_req, arrow_req;
           gint border_width, xthickness, ythickness;
 
+          gtk_widget_size_request (combo_box->priv->button, &button_req);
           border_width = GTK_CONTAINER (combo_box->priv->button)->border_width;
           xthickness = combo_box->priv->button->style->xthickness;
           ythickness = combo_box->priv->button->style->ythickness;
@@ -1223,8 +1223,8 @@ gtk_combo_box_size_request (GtkWidget      *widget,
 
           width = bin_req.width + sep_req.width + arrow_req.width;
 
-          height += border_width + 1 + xthickness * 2 + 4;
-          width += border_width + 1 + ythickness * 2 + 4;
+          height += border_width + 1 + ythickness * 2 + 4;
+          width += border_width + 1 + xthickness * 2 + 4;
 
           requisition->width = width;
           requisition->height = height;
@@ -1242,13 +1242,14 @@ gtk_combo_box_size_request (GtkWidget      *widget,
   else
     {
       /* list mode */
-      GtkRequisition button_req;
+      GtkRequisition button_req, frame_req;
 
       /* sample + frame */
       *requisition = bin_req;
 
       if (combo_box->priv->cell_view_frame)
         {
+         gtk_widget_size_request (combo_box->priv->cell_view_frame, &frame_req);
           requisition->width += 2 *
             (GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
              GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);